/*
 * Copyright 2012 Faculty of Informatics - Masaryk University.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cz.muni.fi.pa165.creatures.services;

import cz.muni.fi.pa165.creatures.dto.CreatureTypeDTO;
import cz.muni.fi.pa165.creatures.dto.WeaponDTO;
import java.util.List;

/**
 * This interface offers API for the implementation in order to be able execute
 * very basic crud-like operations upon
 * {@link cz.muni.fi.pa165.creatures.dto.WeaponDTO}.
 *
 * @author xhajek11
 */
public interface WeaponService {

    /**
     * Create a new weapon.
     *
     * @param weapon the weapon to be created
     * @return id of the created weapon
     */
    Long create(WeaponDTO weapon);

    /**
     * Update existing weapon.
     *
     * @param weapon the weapon to be updated
     */
    void update(WeaponDTO weapon);

    /**
     * Remove existing weapon.
     *
     * @param weapon the weapon to be removed
     */
    void remove(WeaponDTO weapon);

    /**
     * Get a weapon by its id.
     *
     * @param id id of a weapon we want to get
     * @return the weapon with the given {@code id} or null if the weapon
     * doesn't exist
     */
    WeaponDTO getById(Long id);

    /**
     * Get count of all weapons.
     *
     * @return number of all weapons or null if error occurs
     */
    Long getCount();

    /**
     * Get all weapons.
     *
     * @return list of all weapons
     */
    List<WeaponDTO> getAll();

    /**
     * Get all Weapons which are not asociated to given creatureType.
     *
     * @param creatureTypeDTO type of creature
     * @return list of weapons that are not associated to given creature type
     */
    List<WeaponDTO> getAllNotAsignedByCreatureType(final CreatureTypeDTO creatureTypeDTO);

    /**
     * Remove all existing weapons.
     */
    void removeAll();

    /**
     * Gets a weapon by its name.
     * @param name name of a weapon to get
     * @return weapon with a specified name
     */
    WeaponDTO getByName(String name);
}

